package st.business.tepth.business.visitor.visitorwork.work;

import java.util.List;

import st.business.tepth.base.OnDataConvertListener;
import st.shadow.library.ui.recycler.MultipleItemEntity;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-06-05 16:31
 */

public class WorkPresenter extends WorkContract.Presenter {
    private final WorkContract.View mView;
    private final WorkContract.Model mModel;

    public WorkPresenter(WorkContract.View view) {
        mView = view;
        mModel = new WorkModel();
    }

    @Override
    void getClassificationList(int repairId) {
        addDisposable(mModel.getClassificationList(repairId, new OnDataConvertListener<List<MultipleItemEntity>>() {
            @Override
            public void convert(List<MultipleItemEntity> list) {
                mView.showClassification(list);
            }

            @Override
            public void error(int code, String msg) {
                mView.showClassification(null);
            }
        }));
    }
}
